package com.oceansoft.mobile.biz.api.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.oceansoft.mobile.biz.api.entity.News;
import com.oceansoft.mobile.common.base.entity.Result;
import com.oceansoft.mobile.common.dao.ICommonDao;

@Service
public class ApiNewsServiceImpl implements IApiNewsService{

	@Resource
	private ICommonDao commonDao;
	
	@Override
	public Result addNews(News news) {
		try {
			// 保存产品主表信息
			commonDao.saveOne("INSERT INTO api_news(title,orginal_url,pub_time,author,content,img_url,status) VALUES"
									+ "(:title,:orginalUrl,:pubTime,:author,:content,:imgUrl,:status)",
									news);
		} catch (Exception e) {
			e.printStackTrace();
			return new Result(Result.FAILURE,"添加失败!");
		}
		return new Result(Result.SUCC,"添加成功!");
	}
}
